{
short int icon_num;
unsigned int i, num_waypts, create_date, create_time;
- int text_len;
char buff[MAXUSRSTRINGSIZE + 1];
num_waypts = gbfgetint32(file_in);
gbfgetint16(file_in);
/* Waypoint name; input is 2 bytes per char, we convert to 1 */
- text_len = lowranceusr4_readstr(&buff[0], MAXUSRSTRINGSIZE, file_in, 2);
+ int text_len = lowranceusr4_readstr(&buff[0], MAXUSRSTRINGSIZE, file_in, 2);
if (text_len) {
buff[text_len] = '\0';
wpt_tmp->shortname = buff;
static void
lowranceusr4_parse_trails()
{
- int num_trails, M, i, j, k, trk_num, text_len;
+ int num_trails, M, i, j, k, trk_num;
char buff[MAXUSRSTRINGSIZE + 1];
Waypoint* wpt_tmp;
gbfgetint16(file_in);
/* Trail name; input is 2 bytes per char, we convert to 1 */
- text_len = lowranceusr4_readstr(&buff[0], MAXUSRSTRINGSIZE, file_in, 2);
+ int text_len = lowranceusr4_readstr(&buff[0], MAXUSRSTRINGSIZE, file_in, 2);
if (text_len) {
buff[text_len] = '\0';
trk_head->rte_name = buff;
Waypoint* testwpt;
/* total nodes (waypoints) this route */
- unsigned int rte_datapoints = 0;
if (rte->waypoint_list.next) {
// this test doesn't do what I w ant i.e test if this is a valid
// route - treat as a placeholder for now .
-
time_t uniqueValue = 0;
+ unsigned int rte_datapoints = 0;
queue *elem, *tmp;
QUEUE_FOR_EACH(&rte->waypoint_list, elem, tmp) {
testwpt = (Waypoint*)elem;
if (psit_track_state == 2) {
/* total nodes (waypoints) this track */
- unsigned int trk_datapoints = 0;
if (trk->waypoint_list.next) { /* this test doesn't do what I want i.e test if this is a valid track - treat as a placeholder for now */
+ unsigned int trk_datapoints = 0;
QUEUE_FOR_EACH(&trk->waypoint_list, elem, tmp) {
if (trk_datapoints == 0) {
Waypoint* testwpt = (Waypoint*)elem;
{
char buff[16];
short track_count, waypoint_count;
- double lat_scale, lon_scale, amt;
- int i, j;
/* track count */
track_count = gbfgetint16(tpo_file_in);
/* chunk name: "CTopoRoute" */
gbfread(&buff[0], 1, 12, tpo_file_in);
- for (i=0; i<track_count; i++) {
+ for (int i = 0; i < track_count; i++) {
route_head* track_temp = route_head_alloc();
track_add_head(track_temp);
std::vector<short> lat_delta(waypoint_count);
std::vector<short> lon_delta(waypoint_count);
- for (j = 0; j < waypoint_count; j++) {
+ for (int j = 0; j < waypoint_count; j++) {
/* get this point's longitude delta from the first waypoint */
lon_delta[j] = gbfgetint16(tpo_file_in);
}
/* 8 bytes - longitude delta to degrees scale */
- lon_scale = gbfgetdbl(tpo_file_in);
+ double lon_scale = gbfgetdbl(tpo_file_in);
/* 8 bytes - latitude delta to degrees scale */
- lat_scale = gbfgetdbl(tpo_file_in);
+ double lat_scale = gbfgetdbl(tpo_file_in);
/* 4 bytes: the total length of the route in feet*/
gbfread(&buff[0], 1, 4, tpo_file_in);
gbfread(&buff[0], 1, 2, tpo_file_in);
/* multiply all the deltas by the scaling factors to determine the waypoint positions */
- for (j = 0; j < waypoint_count; j++) {
+ for (int j = 0; j < waypoint_count; j++) {
Waypoint* waypoint_temp = new Waypoint;
-
+ double amt;
/* convert incoming NAD27/CONUS coordinates to WGS84 */
GPS_Math_Known_Datum_To_WGS84_M(
- first_lat-lat_delta[j]*lat_scale,
- first_lon+lon_delta[j]*lon_scale,
+ first_lat-lat_delta[j] * lat_scale,
+ first_lon+lon_delta[j] * lon_scale,
0.0,
&waypoint_temp->latitude,
&waypoint_temp->longitude,
return(waypoint_temp);
}
-#define TRACKNAMELENGTH 256
+#define TRACKNAMELENGTH 255
class StyleInfo {
public:
QString name;
static void tpo_process_tracks()
{
unsigned int track_count, track_style_count;
- unsigned int tmp;
-
const int DEBUG = 0;
if (DEBUG) {
styles[ii].color[xx] = (uint8_t)col;
}
- tmp = (unsigned char) gbfgetc(tpo_file_in);
+ unsigned char tmp = gbfgetc(tpo_file_in);
// printf("Skipping unknown byte 0x%x after color\n",tmp);
// byte for name length, then name
- tmp = (unsigned char) gbfgetc(tpo_file_in);
+ tmp = gbfgetc(tpo_file_in);
// wrong byte order?? tmp = tpo_read_int(); // 16 bit value
// printf("Track %d has %d-byte (0x%x) name\n", ii, tmp, tmp);
if (tmp >= TRACKNAMELENGTH) {
// clumsy way to skip two undefined bytes
for (unsigned xx = 0; xx < 2; xx++) {
- tmp = (unsigned char) gbfgetc(tpo_file_in);
- // printf("Skipping final byte 0x%x\n",tmp);
+ tmp = gbfgetc(tpo_file_in);
+ // printf("Skipping final byte 0x%x\n", tmp);
}
if (DEBUG) {
- printf("Track style %d: color=#%02x%02x%02x, width=%d, dashed=%d, name=%s\n",
+ printf("Track style %u: color=#%02x%02x%02x, width=%d, dashed=%d, name=%s\n",
ii, styles[ii].color[0], styles[ii].color[1], styles[ii].color[2],
styles[ii].wide, styles[ii].dash, qPrintable(styles[ii].name));
}